package org.stvd.entities.admin;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import org.springframework.format.annotation.DateTimeFormat;
import org.stvd.core.annotation.serializer.DateTimeSerializer;
import org.stvd.entities.base.BaseEntity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;

/**
 * 用户登录账号-实体类
 * @author houzx
 */
@Entity
@Table(name="user_login")
public class UserLogin extends BaseEntity{
    
    private static final long serialVersionUID = 3205348626676688839L;
    
    /**
     * 主键ID
     */
    @Id
    @Column(name="id",nullable=false)
    private String id = "";
    
    /**
     * 用户ID
     */
    @Column(name="user_id",nullable=false)
    private String userId = "";
    
    /**
     * 登录类型  UserLoginType枚举类中
     */
    @Column(name="login_type",nullable=false)
    private String loginType = "";
    
    /**
     * 登录账号
     */
    @Column(name="login_account",nullable=false)
    private String loginAccount = "";
    
    /**
     * 启用状态{ 0：禁用 1：启用}
     */
    @Column(name="login_status",nullable=false)
    private String loginStatus = "1";
    
    /**
     * 创建人
     */
    @Column(name="create_user")
    private String createUser = "";
    
    /**
     * 创建时间
     */
    @Column(name="create_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = DateTimeSerializer.class)
    private Date createTime = null;
    
    /**
     * 修改时间
     */
    @Column(name="modify_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = DateTimeSerializer.class)
    private Date modifyTime = null;
    
    public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getUserId() {
        return userId;
    }
    public void setUserId(String userId) {
        this.userId = userId;
    }
   
    public String getLoginType() {
        return loginType;
    }
    public void setLoginType(String loginType) {
        this.loginType = loginType;
    }
    
    public String getLoginAccount() {
        return loginAccount;
    }
    public void setLoginAccount(String loginAccount) {
        this.loginAccount = loginAccount;
    }
    
    public String getLoginStatus() {
        return loginStatus;
    }
    public void setLoginStatus(String loginStatus) {
        this.loginStatus = loginStatus;
    }
    
    public String getCreateUser() {
        return createUser;
    }
    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Date getModifyTime() {
        return modifyTime;
    }
    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }
    public UserLogin() {}
    
    public UserLogin(String id, String userId, String loginType, String loginAccount, String loginStatus,
            String createUser, Date createTime, Date modifyTime) {
        super();
        this.id = id;
        this.userId = userId;
        this.loginType = loginType;
        this.loginAccount = loginAccount;
        this.loginStatus = loginStatus;
        this.createUser = createUser;
        this.createTime = createTime;
        this.modifyTime = modifyTime;
    }
}
